package com.leadnews.mapper;

import com.leadnews.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leadnews.vo.UserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 自己
* @description 针对表【user】的数据库操作Mapper
* @createDate 2023-01-15 22:34:26
* @Entity com.leadnews.pojo.User
*/
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where email=#{email}")
    User findByMail(@Param("email") String email);
@Select("select * from user where username=#{username}")
    User findByUsername(@Param("username") String username);
    @Select("select * from user where (username=#{username} and password=#{password}) or (email=#{username} and password=#{password})")
    User findByMailOrPas(@Param("username") String username, @Param("password") String password);
@Select("SELECT id,name,picture from level where user_id in(SELECT id FROM user where username like concat('%',#{username},'%') )")
    List<UserVo> searchchart(@Param("username")String username);
}




